package com.jnu.bookmanagermainactivity;

import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ListView;


public class SearchBookItemActivity extends AppCompatActivity {

    private EditText editSearchTitle;
    private ImageButton buttonDelete;
    private ListView listView;
    private Button buttonSearch;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search_book_item);

        Context context = this;
        initView();
    }

    private void initView() {
        buttonSearch = (Button) findViewById(R.id.button_search);
        editSearchTitle = (EditText) findViewById(R.id.edittext_book_item_search);
        buttonDelete = (ImageButton) findViewById(R.id.button_delete);
        listView = (ListView) findViewById(R.id.listview);

        //设置搜索界面删除按钮的点击事件
        buttonDelete.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //把EditText内容设置为空
                editSearchTitle.setText("");
                //把ListView隐藏
                listView.setVisibility(View.GONE);
            }
        });


    }



}